﻿
@using (Ajax.BeginForm("ListPartialView", "File", new AjaxOptions
    {
        HttpMethod = "POST",
        //OnBegin = "function(){ loadingPanel.Show(); }",
        //OnComplete = "function(){ loadingPanel.Hide(); }",
        UpdateTargetId = "list-users",
        InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace
        
    }))
    {
        @UserQuery.CreateQuery(setting => {
       setting.QueryKey = QuerySettings.FileList;
           setting.Columns.Add(new QueryColumn() { Field = "FileName2", Name = "文件名称" });
           setting.Columns.Add(new QueryColumn() { Field = "Note", Name = "描述" });
        })
}

<div id="list-users">
    @Html.Action("ListPartialView", new {id= Html.ViewContext.RouteData.Values["id"]  })
</div>
<hr />
 @Html.DevExpress().Button(settings =>
{
    string file_type = Html.ViewContext.RouteData.Values["id"].ToSafeString().IsNull("FILE");
    settings.Name = "Button1";
    if(file_type=="FILE")
        settings.Text = "增加文件";
    else
        settings.Text = "增加法律法规";
    settings.Width = 120;
    settings.ControlStyle.CssClass = "button1";
    settings.Enabled = CurrentUser.CheckPermission(PermissionManager.上传文件);
    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("New", "File", new { file_type = file_type }) + "' }";
}).GetHtml()